package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-03 14:51
 */
@Repository /* 描述数据层实现类 */
public class GoodsDaoImpl implements GoodsDao {

    @Autowired
    private SqlSession sqlSession;

    @Override
    public List<Goods> findGoods() {
        //return sqlSession.getMapper(GoodsDao.class).findGoods();
        /* 上面的最终会转换为下面的 下面的性能更优异 */
        return sqlSession.selectList("com.cy.pj.goods.dao.GoodsDao.findGoods");
    }

}
